/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controladora;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import telas.ManterGerenteView;
import telas.DiretorRegionalView;
import telas.LoginView;
import telas.ManterAgenciaView;

/**
 *
 * @author Thalyta
 */
public class DiretorRegionalPresenter {

    private DiretorRegionalView regionalview ;
    
    public DiretorRegionalPresenter( DiretorRegionalView telareginal) {
     
        regionalview = telareginal; 
      
      
        regionalview.getMnucadastrar().addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                   
               cadastrar();
              
            }

          
        });
        
        regionalview.getMnualterar().addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
              
                alterar();
            }
        });
        
        regionalview.getMnuexcluir().addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
              
               editar();
            }
        });
        
        regionalview.getMnuconsultar().addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
              
         consultar();
         
            }
        });
        
          regionalview.getMnusair1().addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                LoginView logan = new LoginView();
           LoginPresenter login = new LoginPresenter(logan);
           regionalview.setVisible(false);
            }
        });
        
 
    regionalview.getMnuDesativarAcesso().addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
              
               DesativarAcesso();
            }
        });
    regionalview.getMnuCadastrarGerente().addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
              CadastrarGerente();
            }
        });
    
    regionalview.getMnutransferir().addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
              
               transferir();
            }
        });
    
      regionalview.setVisible(true); 
        
}
    
    
    public void consultar(){
         ManterAgenciaView telamanter = new ManterAgenciaView();
         ManterAgenciaPresenter contagencia = new ManterAgenciaPresenter(telamanter);
         regionalview.setVisible(false);
    
    }
    
    public void DesativarAcesso(){
        ManterGerenteView gerente = new ManterGerenteView();
        ManterGerentePresenter contgerente = new ManterGerentePresenter(gerente);              
        regionalview.setVisible(false);  
    
    }
    public void cadastrar(){

        ManterAgenciaView telamanter = new ManterAgenciaView();
        ManterAgenciaPresenter contagencia = new ManterAgenciaPresenter(telamanter);
        regionalview.setVisible(false);
    
    }
    
    public void alterar(){
    ManterAgenciaView telamanter = new ManterAgenciaView();
    ManterAgenciaPresenter contagencia = new ManterAgenciaPresenter(telamanter);
    regionalview.setVisible(false);
    
    }
    
   public void excluir(){
   
   
   
   }
   
   public void editar(){
       
    ManterAgenciaView telamanter = new ManterAgenciaView();
    ManterAgenciaPresenter contagencia = new ManterAgenciaPresenter(telamanter);
    regionalview.setVisible(false);
   
   
   }
   
  
   public void transferir(){
    ManterGerenteView gerente = new ManterGerenteView();
    ManterGerentePresenter contgerente = new ManterGerentePresenter(gerente);
    regionalview.setVisible(false);
   }
   
   public void CadastrarGerente(){
    
    ManterGerenteView gerente = new ManterGerenteView();
    ManterGerentePresenter contgerente = new ManterGerentePresenter(gerente);
    regionalview.setVisible(false);
   
   }
}

